
function closedivxxt2(){ //关闭层
 document.getElementById('bodycov').style.display='none';
 document.getElementById('covBg').style.display='none';
 document.getElementById('creatdiv').style.display='none';
// document.body.removeChild(document.getElementById('creatdiv'));
}
function closediv2(){ //关闭层
 //document.getElementById('creatdiv').parentNode.removeChild(document.getElementById('creatdiv'));
 parent.parent.parent.parent.document.getElementById('bodycov').style.display='none';
 parent.parent.parent.parent.document.getElementById('covBg').style.display='none';
 parent.parent.parent.parent.document.getElementById('creatdiv2').style.display='none';
}
function closediv3(s){//xxtdelconfirm
	//alert(s);
	//alert(this.parent.parent.document.body.innerHTML)
	//closediv2();
	this.parent.parent.parent.parent.document.getElementById('bodycov').style.display='none';
	this.parent.parent.parent.parent.document.getElementById('covBg').style.display='none';
	this.parent.parent.parent.parent.document.getElementById('creatdiv2').style.display='none';
	//del(s);
	}
function closediv4(s){//delconfirm
	//alert(s);
	//alert(this.parent.parent.document.body.innerHTML)
	closediv2();
	this.parent.parent.parent.parent.document.getElementById('bodycov').style.display='none';
	this.parent.parent.parent.parent.document.getElementById('covBg').style.display='none';
	this.parent.parent.parent.parent.document.getElementById('creatdiv2').style.display='none';
	del(s);
	}
function xxtconfirm(s1,s2){			 //只有确定按钮的提示
	//alert('mis')
	s1=s1||'数字校园提示您!';
	s2=s2||'添加成功！'
	//if(abc()=='ie6'){alert(s2);return;}
		//alert('mis-------------\ns1:'+s1+"\n"+"s2:"+s2);
		 parent.parent.parent.parent.document.getElementById('bodycov').style.display='block';
	 parent.parent.parent.parent.document.getElementById('covBg').style.display='block';
	 var creatdiv= parent.parent.parent.parent.document.getElementById('creatdiv');
		//var creatdiv=document.createElement('div');
		 //parent.parent.parent.parent.document.body.appendChild(creatdiv);
		 //creatdiv.style.zIndex='4000';
		creatdiv.style.top=(parent.parent.parent.parent.document.body.clientHeight-174)/2+'px';
		creatdiv.style.left=(parent.parent.parent.parent.document.body.clientWidth-412)/2+'px';
		creatdiv.style.display='block';
		creatdiv.innerHTML='<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%"><tr><td width="100%" id="creatdiv_top" onMouseOver="movediv(\'creatdiv\',\'creatdiv_top\')" onMouseOut="mosout()">'+s1+'</td></tr><tr align="center"><td align="center" valign="middle" id="creatdiv_middle"><div style="width: 410px;height: 110px;overflow: auto;" align="center"><table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%"><tr><td align="center" valign="middle" id="msgtips">'+s2+'</td></tr></table></div></td></tr><tr><td id="creatdiv_bot" align="right"><input type="button" value="确&nbsp;定" onClick="closedivxxt2()"></td></tr></table>'
		
	}
function DelConfirm(subjectId,s1){//删除对话框，传入需要删除记录的ID
	s1=s1||'数字校园提示您!';
	 parent.parent.parent.parent.document.getElementById('bodycov').style.display='block';
	 parent.parent.parent.parent.document.getElementById('covBg').style.display='block';
 
	var creatdiv=parent.parent.parent.parent.document.getElementById('creatdiv2');
	creatdiv.style.top=(parent.parent.parent.parent.document.body.clientHeight-174)/2+'px';
	creatdiv.style.left=(parent.parent.parent.parent.document.body.clientWidth-412)/2+'px';
	creatdiv.style.display='';
	parent.parent.parent.parent.document.getElementById('creatdiv_top2').innerHTML=s1;
	parent.parent.parent.parent.document.getElementById('creatdiv_middle2').innerHTML='您确认删除此记录吗？';
	var surebot=parent.parent.parent.parent.document.getElementById('removesomnone');
	if(window.addEventListener){ 
		surebot.addEventListener('click',function(){closediv4(subjectId)},false);
	   } else {
		surebot.attachEvent('onclick',function(){closediv4(subjectId)});	
		}
	}	
function xxtsubmitconfirm(s1,s2){                     //表单验证不通过时提示并返回false,不提交表单
	s1=s1||'数字校园提示您!';
	s2=s2||'出错了，不能提交表单！';
	parent.parent.parent.parent.document.getElementById('bodycov').style.display='block';
	parent.parent.parent.parent.document.getElementById('covBg').style.display='block';
 
	var creatdiv=parent.parent.parent.parent.document.getElementById('creatdiv');
	creatdiv.style.top=(parent.parent.parent.parent.document.body.clientHeight-174)/2+'px';
	creatdiv.style.left=(parent.parent.parent.parent.document.body.clientWidth-412)/2+'px';
	creatdiv.style.display='';
	parent.parent.parent.parent.document.getElementById('creatdiv_top').innerHTML=s1;
	parent.parent.parent.parent.document.getElementById('creatdiv_middle').innerHTML=s2;
	return false;
}

var getAbsoluteCoords = function (e) {
var width = e.offsetWidth;
var height = e.offsetHeight;
var left = e.offsetLeft;
var top = e.offsetTop;
var right = left+width;
var bottom = top+height;
return {
  'width': width,
  'height': height,
  'left': left,
  'top': top,
  'right': right,
  'bottom': bottom
};
};

function movediv(s1,s2) {
	var wrap = document.getElementById(s1);
	document.getElementById(s2).style.cursor ="move";
	if (window.ActiveXObject)
	  wrap.onselectstart = function () { event.returnValue = false; }
	document.onmousedown = function (evt) {
	  evt = window.event||evt; 
	  var a=getAbsoluteCoords(wrap);
	  wrap.cx=evt.clientX-a.left;
	  wrap.cy=evt.clientY-a.top;
	  document.onmousemove = function (evt) {
		evt = window.event||evt; try {
			wrap.style.left = (evt.clientX-wrap.cx)+"px";
			wrap.style.top = (evt.clientY-wrap.cy)+"px";
		} catch (ex) {};
	  };
		 document.onmouseup = function () {
		document.onmousemove = null;
		document.onmouseup = null;
		wrap.style.cursor="default";
	  }
	}
  }
function mosout()
  {
  document.onmousedown=null;
  document.onmousemove = null;
  document.onmouseup = null;
  //wrap.style.cursor="default";
  }

function returnfunction(){
	document.getElementById("main").contentWindow.returnfunction2();
}

function delAffection(uid,cid){
	document.getElementById("main").contentWindow.returnfunction2(uid,cid);
}

function xxtDelConfirm(dosomething,s1,s2,s3,s4,s5,s6){	//删除对话框，传入方法
	//alert(dosomething)
	s1=s1||'数字校园提示您!';//s1参数为弹出层头部
	s2=s2||'您确认删除此记录吗？'//s2参数为弹出层内容
	//dosomething参数为点击确定按钮后执行的函数
	//s3,s4为确定按钮执行时需要用到的参数;
	 parent.parent.parent.parent.document.getElementById('bodycov').style.display='block';
	 parent.parent.parent.parent.document.getElementById('covBg').style.display='block';
	var creatdiv=parent.parent.parent.parent.document.getElementById('creatdiv2');
	creatdiv.style.top=(parent.parent.parent.parent.document.body.clientHeight-174)/2+'px';
	creatdiv.style.left=(parent.parent.parent.parent.document.body.clientWidth-412)/2+'px';
	creatdiv.style.display='';
	parent.parent.parent.parent.document.getElementById('creatdiv_top2').innerHTML=s1;
	parent.parent.parent.parent.document.getElementById('creatdiv_middle2').innerHTML=s2;
	var bot='<input typut="button" value="确&nbsp;定" style="cursor:pointer" onClick="changeClassabc(\''+dosomething+'\',\''+s3+'\',\''+s4+'\',\''+s5+'\',\''+s6+'\');closediv2();"><input type="button" value="取&nbsp;消" style="cursor:pointer" onClick="closediv2()">';
	parent.parent.parent.parent.document.getElementById('creatdiv_bot2').innerHTML=bot;	
	}
function changeClassabc(s,s1,s2,s3,s4){
	closediv2();
	if(s=='delAction'){
		document.getElementById("main").contentWindow.document.getElementById("neirong").contentWindow.delAction(s1,s2);
	}
	if(s=='deleteOne'){
		document.getElementById("main").contentWindow.document.getElementById("neirong").contentWindow.deleteOne(s1);
	}
	if(s=='delUser'){
		document.getElementById("main").contentWindow.document.getElementById("neirong").contentWindow.delUser(s1);
	}
	if(s=='delGroup'){
		document.getElementById("main").contentWindow.document.getElementById("neirong").contentWindow.delGroup(s1);
	}
	if(s=='allDelUser'){
		document.getElementById("main").contentWindow.document.getElementById("neirong").contentWindow.allDelUser();
	}
	if(s=='delFileFolder'){
		document.getElementById("main").contentWindow.document.getElementById("neirong").contentWindow.delFileFolder(s1,s2);
	}
	if(s=='deleteJsOne'){
		document.getElementById("main").contentWindow.document.getElementById("neirong").contentWindow.deleteJsOne(s1);
	}
	if(s=='deleteJsAll'){
		document.getElementById("main").contentWindow.document.getElementById("neirong").contentWindow.deleteJsAll();
	}
	if(s=='delOneOrg'){
		document.getElementById("main").contentWindow.document.getElementById("neirong").contentWindow.delOneOrg(s1);
	}
	if(s=='jwDeleteAll'){
		document.getElementById("main").contentWindow.document.getElementById("neirong").contentWindow.jwDeleteAll();
	}
	if(s=='jwdeleteOne'){
		document.getElementById("main").contentWindow.document.getElementById("neirong").contentWindow.jwdeleteOne(s1,s2,s3,s4);
	}
	
	if(s=='ggDeleteAll'){
		document.getElementById("main").contentWindow.document.getElementById("neirong").contentWindow.ggDeleteAll();
	}
	if(s=='ggdeleteOne'){
		document.getElementById("main").contentWindow.document.getElementById("neirong").contentWindow.ggdeleteOne(s1,s2,s3,s4);
	}
	if(s=='deleteSmOne'){
		document.getElementById("main").contentWindow.document.getElementById("neirong").contentWindow.deleteSmOne(s1);
	}
	if(s=='SureDels'){
		document.getElementById("main").contentWindow.document.getElementById("neirong").contentWindow.SureDels();
	}
	if(s=='dellAllSm'){
		document.getElementById("main").contentWindow.document.getElementById("neirong").contentWindow.dellAllSm();
	}
	if(s=='delNbyj'){
		document.getElementById("main").contentWindow.document.getElementById("neirong").contentWindow.delNbyj(s1,s2,s3);
	}
	if(s=='ryDeleteAll'){
		document.getElementById("main").contentWindow.document.getElementById("neirong").contentWindow.ryDeleteAll();
	}
	if(s=='rydeleteOne'){
		document.getElementById("main").contentWindow.document.getElementById("neirong").contentWindow.rydeleteOne(s1,s2);
	}
	if(s=='changeClass'){
		document.getElementById("main").contentWindow.document.getElementById("menu_iframe").contentWindow.changeClass(s1,s2);
	}
	if(document.getElementById("main").contentWindow.document.getElementById("con")){
		document.getElementById("main").contentWindow.document.getElementById("con").contentWindow.del();
	}
	if(document.getElementById("main").contentWindow.document.getElementById("menu_iframe2")){
		document.getElementById("main").contentWindow.document.getElementById("menu_iframe2").contentWindow.ly_del();
	}
	if(document.getElementById("main").contentWindow.document.getElementById("menu_iframe")){
		document.getElementById("main").contentWindow.document.getElementById("menu_iframe").contentWindow.returnfunction2();
	}
}


function textCleans(e,str){
	e.style.color='#000'
	if(e.value=str){
	e.value="";
	}
     }
     

	
 
function textBacks(e,str){
//	var vi=document.getElementById("conditionTemp");
	if(e.value !=str){
	if(e.value==''){
	e.value=str;
	e.style.color='#ccc'
	}
	}
	}
